#include <iostream>
#include <string>
using namespace std;
int main()
{
    int c = 0;
    int x = 0;
    string s;
    string stek = "";
    s = "()()([()])";
    for (char i: s){
            if (i == '('){c = c + 1;}
            else{
                if (i == ')'){c = c - 1;cout << c;}
                else{
                if (i == '['){ x = x + 1;}
                else {x = x - 1;}}
    }}


    if(c == 0 && x == 0) cout << "True";
    else
        if (stek[stek.length()-1] == '(') stek.pop_back();



if (stek.length() == 0)cout << "true";
else cout << "false";


}
